package main

import "time"

type cache struct {
	data map[string]entry
}

type entry struct {
	Value     interface{}
	Timestamp time.Time
	Static    bool
}

func (c *cache) set(m map[string]entry) error {
	for k, v := range m {
		err := c.setEntry(k, v)
		if err != nil {
			return err
		}
	}
	return nil
}

func (c *cache) setEntry(key string, v entry) error {
	if c.data == nil {
		c.data = map[string]entry{}
	}
	c.data[key] = v
	return nil
}

func (c *cache) getAll() map[string]entry {
	return c.data
}
